package init;


import models.User;
import play.jobs.Job;
import play.jobs.OnApplicationStart;

/**
 * 
 * @author Cheng
 * 2014/9/22
 */
@OnApplicationStart
public class UserInit extends Job{
	
	@Override
	public void doJob(){
		User admin = User.findByUsername("Admin");
		if(admin == null){
			admin = new User();
			admin.account = "Admin";
			admin.password = "Admin";
            admin.authority = User.SuperAdmin;
			admin.save();
			
		}
	}

}
